]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Workspace: ignore actual geometry changes while unmapped
authorGiovanni Campagna <gcampagna@src.gnome.org>
Thu, 8 May 2014 17:16:10 +0000 (19:16 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Thu, 26 Jun 2014 17:20:17 +0000 (19:20 +0200)
If unmapped, ignore geometry changes. This avoids doing useless
layout work on invisible workspaces during the slider control
animations.

https://bugzilla.gnome.org/show_bug.cgi?id=729823

js/ui/workspace.js

index 464c3c2c1612a6ff25999210e0af30230c3a45f0..adad46fad6dfcbf9b17a9f4af8f4ca22631cc735 100644 (file)
@@ -1140,6 +1140,11 @@ const Workspace = new Lang.Class({
 
         this._positionWindowsFlags = 0;
         this._positionWindowsId = 0;
+
+        this.actor.connect('notify::mapped', Lang.bind(this, function() {
+            if (this.actor.mapped)
+                this._syncActualGeometry();
+        }));
     },
 
     setFullGeometry: function(geom) {
@@ -1147,7 +1152,9 @@ const Workspace = new Lang.Class({
             return;
 
         this._fullGeometry = geom;
-        this._recalculateWindowPositions(WindowPositionFlags.NONE);
+
+        if (this.actor.mapped)
+            this._recalculateWindowPositions(WindowPositionFlags.NONE);
     },
 
     setActualGeometry: function(geom) {
@@ -1155,18 +1162,29 @@ const Workspace = new Lang.Class({
             return;
 
         this._actualGeometry = geom;
+        this._actualGeometryDirty = true;
+
+        if (this.actor.mapped)
+            this._syncActualGeometry();
+    },
 
-        if (this._actualGeometryLater)
+    _syncActualGeometry: function() {
+        if (this._actualGeometryLater || !this._actualGeometryDirty)
+            return;
+        if (!this._actualGeometry)
             return;
 
         this._actualGeometryLater = Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this, function() {
+            this._actualGeometryLater = 0;
+            if (!this.actor.mapped)
+                return false;
+
             let geom = this._actualGeometry;
 
             this._dropRect.set_position(geom.x, geom.y);
             this._dropRect.set_size(geom.width, geom.height);
             this._updateWindowPositions(Main.overview.animationInProgress ? WindowPositionFlags.ANIMATE : WindowPositionFlags.NONE);
 
-            this._actualGeometryLater = 0;
             return false;
         }));
     },